The size of programs written in an assembly level language has in the past been limited by the address range provided by the address fields of the instructions. The address range defined a logical address space in which a main program including all of its subroutines and its data work storage resided.
To overcome the logical address space limitation, application programmers have provided for overlaying portions of the program with other portions of the program read in from an I/O device. Overlay allows the size of the program to exceed the available address space by reusing portions of the address space for different parts of the program in time sequence. Program overlay requires the application writer to preplan the use of logical address space. Program overlay becomes exceedingly complex in large application programs.
As tasks become more complex, there has been a need to provide more logical address space without being concerned about execution sequence.
Another method of accessing more logical address space was provided in the IBM 3600 Finance Communication System wherein circuits were provided which would fetch instructions from one logical address space or segment and would perform data fetches and stores in another logical address space or segment. This method effectively doubles the available address space but neither the program or the data can exceed the original address space size.
An improvement on the above described simple method is provided by the method used by the cross memory feature of the IBM 370 architecture. The cross memory feature of the IBM 370 system adds several instructions (e.g. program call, move primary, program transfer, etc.) which pass program execution across virtual address space or segment boundaries using general purpose registers (GPR) 3 and 14 and control registers 1 and 7. GPR 3 contains the return address space and GPR 14 contains the return instruction counter. Control register 1 contains the segment table pointer for the new address space and control register 7 contains the segment table pointer for the old or calling address space. The cross memory feature allows calls across address space boundaries and data movement across address space boundaries.
More recently, the Intel Corporation has announced a microprocessor system which uses a stack oriented combination of the above described methods. In the Intel Corporation microprocessor, code segment and data segment address spaces are defined by the contents of a special code segment register and a special data segment register. A stack segment register and an extra data segment register are also provided. The content of a segment register is shifted and added by processor circuits to the logical address from a program instruction to create an address in a much larger address space than could be defined by the address fields of the instructions. An address space or segment starts with the address in the segment register and runs for 64K bytes, coextensively with other address spaces that may have been defined by other programs to start at nearby addresses. Each program can execute a move instruction to change the base address in a segment register. An intersegment call instruction is also provided which includes a field for updating the code segment register to pass execution to a program in another address space. In addition to updating the code segment register, the calling program segment base address and the calling program instruction count are pushed onto the stack. When the called program executes an intersegment return, the segment base address and instruction count for the calling program are popped from the stack for continued execution.
The above prior art architectures provide for passing program execution control to program instructions outside of a logical address space but do not effectively provide for data address space management, particularly for reentrant or recursive program execution.
For example, the calling program needs to have a measure of control over whether the called program shall utilize the calling program's address space or a new data address space. On the other hand, the data address space needs of a reentrant or recursively called program are best defined as part of the called program. In the prior art Intel system, the base address of a data address space can be defined either by the calling program or by the called program using a move to segment register command. Because neither program can limit the length of an address space or segment to less than the address range of the address field of an instruction, there is no mechanism to insure that called programs will not write over data stored by another program.